<template>
	<view>
		<test ref="child"></test>
		<button @click="notify" type="default">测试父组件触发子组件{{content}}</button>
	</view>
</template>

<script>
	import test from '../../components/index/test.vue'
	export default {
		data() {
			return {
				id:10000,
				title:'',
				content:'',
			}
		},
		components:{test},
		onShow() {
			uni.$on('msg',(data)=>{
				this.content = data.content;
				console.log(data.title);
				console.log(data.content);
			})
		},
		methods: {
			notify(){
				uni.$emit('jpf',{msg:'页面更新'})
			}
			
		}
	}
</script>

<style>

</style>
